import javafx.application.Application;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Mytest {
    public static void main(String[] args) {
//        加载spring 容器
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
        User user = (User) context.getBean("user");
        System.out.println(user.toString());
    }
    @Test
    public void test1(){
        ApplicationContext contest = new ClassPathXmlApplicationContext("userbean.xml");
        User user2 = contest.getBean("user2",User.class);
        System.out.println(user2);
    }
}
